package com.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 首页-人物介绍 表定义层。
 *
 * @author admin
 * @since 2024-06-25
 */
public class OnecharacterTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 首页-人物介绍
     */
    public static final OnecharacterTableDef ONECHARACTER = new OnecharacterTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 图片
     */
    public final QueryColumn IMAGE = new QueryColumn(this, "Image");

    /**
     * 人物名称
     */
    public final QueryColumn CHARACTERNAME = new QueryColumn(this, "charactername");

    /**
     * 人物介绍
     */
    public final QueryColumn CHARACTERINTRODUCTION = new QueryColumn(this, "characterintroduction");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, CHARACTERNAME, CHARACTERINTRODUCTION, IMAGE};

    public OnecharacterTableDef() {
        super("", "onecharacter");
    }

    private OnecharacterTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public OnecharacterTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new OnecharacterTableDef("", "onecharacter", alias));
    }

}
